<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'deal-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'referenceNo'); ?>
		<?php echo $form->textField($model,'referenceNo',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'referenceNo'); ?>
	</div>
<?php 
$dealBankJs=<<<EOF
$('.deal-bank').click(function(){
	$('#Deal_bank').val($(this).html());
	return false;
});
EOF;
Yii::app()->clientScript->registerScript('loanBankTag',$dealBankJs);
?>
	<div class="row">
		<?php echo $form->labelEx($model,'bank'); ?>
		<?php echo $form->textField($model,'bank',array('size'=>20,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'bank'); ?>
		<?php foreach (Deal::getBankArray() as $dealBank):?> 
			<a href="#" class="deal-bank"><?php echo $dealBank;?></a>
		<?php endforeach; ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->